{extend name='index/base' /}

{block name='main'}
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 会员管理 <span class="c-gray en">&gt;</span> 终端客户 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
    <div class="">
        <form id="myform" style="line-height: 40px" action="">
            <span style="text-align:right;display: inline-block;margin-left: 4px">子账号：</span>
            <input  type="text" value="{$get.zzh}" name="zzh" class="input-text" style="width:150px">
            <span style="text-align:right;display: inline-block;margin-left: 4px">合约：</span>
            <input  type="text" value="{$get.hy}" name="hy" class="input-text" style="width:150px">
            <span style="text-align:right;display: inline-block;margin-left: 4px">开始日期：</span>

            <input type="text" name="start" value="{$get.start}" autocomplete="off"  onfocus="WdatePicker({ maxDate:'#F{ $dp.$D(\'datemax\')||\'%y-%M-%d\'}' })" id="datemin" class="input-text Wdate" style="width:120px;">
            <span style="text-align:right;display: inline-block;margin-left: 4px">结束日期：</span>

            <input type="text" name="end" value="{$get.end}" autocomplete="off"  onfocus="WdatePicker({ maxDate:'#F{ $dp.$D(\'datemax\')||\'%y-%M-%d\'}' })" id="datemax" class="input-text Wdate" style="width:120px;">

            <span style="text-align:right;display: inline-block;">买卖：</span>
            <select  name="mm"  data-am-selected="{searchBox: 1}" style="width: 120px" size="1" id="rna" class="input-text">
                <option  value="" >所有</option>
                <option  value="买" {if condition="$get.mm == '买'"} selected{/if}>买</option>
                <option  value="卖" {if condition="$get.mm == '卖'"} selected{/if}>卖</option>
            </select>

            <!--a21d229c6f1b363dc90a7d16b79f6337-->
            <span style="text-align:right;display: inline-block;">开平：</span>
            <select  name="kp"  data-am-selected="{searchBox: 1}" style="width: 120px" size="1" id="rna" class="input-text">
                <option  value="" >所有</option>
                <option  value="开" {if condition="$get.kp == '开'"} selected{/if}>开</option>
                <option  value="平" {if condition="$get.kp == '平'"} selected{/if}>平</option>
                <option  value="平今" {if condition="$get.kp == '平今'"} selected{/if}>平今</option>
            </select>
            <span style="text-align:right;display: inline-block;">选择代理商：</span>
            <select  name="agent"  data-am-selected="{searchBox: 1}" style="width: 200px" size="1" id="ag" class="input-text">
                <option  value="" >所有</option>
                {foreach name='lists' item='ls'}
                <option  value="{$ls.id}" {if condition="$get.agent == $ls.id"} selected{/if}>{$ls.name}</option>
                {/foreach}
            </select>
            <span style="text-align:right;display: inline-block;"></span>
            <button class="btn btn-success radius">查找</button>
        </form>
    </div>
    <div class="mt-20">
        <div class="dataTables_length mb-15" id="DataTables_Table_0_length">

        </div>

        <table width="100%" class="table table-border table-bordered table-hover table-bg table-sort" id="">
            <thead>
            <tr>
                <th width="10px">总计</th>
                <th width="50px">子账号</th>
                <th width="50px">所属分组</th>
                <th width="50px">交易日</th>
                <th width="50px">合约</th>
                <th width="50px">买卖</th>
                <th width="50px">开平</th>
                <th width="50px">成交价</th>
                <th width="50px">成交量</th>
                <th width="50px">成交金额</th>
                <th width="20px">手续费</th>
                <th width="50px">平仓浮动盈亏</th>
                <th width="50px">基础手续费</th>
                <th width="10px">操作</th>
            </tr>
            </thead>
            <tbody>
            {volist name='list' id='user'}

            <tr class="even gradeC">
                <td></td>
                <td>{$user.Subaccount}</td>
                <td>{$user.Grouping}</td>
                <td>{$user.TradingDday}</td>
                <td>{$user.Contract}</td>
                <td>{$user.Business}</td>
                <td>{$user.Kaiping}</td>
                <td>{$user.Price}</td>
                <td>{$user.Count}</td>
                <td>{$user.Amount}</td>
                <td>{$user.Poundage}</td>
                <td>{$user.Float}</td>
                <td>{$user.Brokerage}</td>
                <td>
                    <a data-toggle="modal" data-target="#myModal1" onclick="rz({$user.Id})">查看详情</a>
                </td>
            </tr>
            {/volist}
            <tr class="even gradeC" style="color: red;">
                <td>总计</td>
                <td>-</td>
                <td>-</td>
                <td>-</td>
                <td>-</td>
                <td>-</td>
                <td>-</td>
                <td>-</td>
                <td>{$count.Count}</td>
                <td>-</td>
                <td>{$count.Poundage}</td>
                <td>{$count.Float}</td>
                <td>{:number_format($count.Brokerage,2)}</td>
                <td>-</td>
            </tr>
            <!-- more data -->
            </tbody>
        </table>
        {$page}
    </div>
</div>
<div class="modal fade" id="myModal1" tabindex="-1" role="dialog" style="margin-top: 15%;" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="name">详情：</h4>
            </div>
            <div class="modal-body" style="line-height: 30px;">
                子账号：<a id="zzh"></a>&nbsp;&nbsp;&nbsp;&nbsp;
                所属分组：<a id="ssfz"></a>&nbsp;&nbsp;&nbsp;&nbsp;
                <br>
                交易日：<a id="jyr"></a>&nbsp;&nbsp;&nbsp;&nbsp;
                <br>
                委托号：<a id="wth"></a>&nbsp;&nbsp;&nbsp;&nbsp;
                成交号：<a id="cjh"></a>&nbsp;&nbsp;&nbsp;&nbsp;
                请求号：<a id="qqh"></a>&nbsp;&nbsp;&nbsp;&nbsp;
                <br>
                交易所：<a id="jys"></a>&nbsp;&nbsp;&nbsp;&nbsp;
                合约：<a id="hy"></a>&nbsp;&nbsp;&nbsp;&nbsp;
                <br>
                买卖：<a id="mm"></a>&nbsp;&nbsp;&nbsp;&nbsp;
                开平：<a id="kp"></a>&nbsp;&nbsp;&nbsp;&nbsp;
                投保：<a id="tb"></a>&nbsp;&nbsp;&nbsp;&nbsp;
                <br>
                成交价：<a id="cjj"></a>&nbsp;&nbsp;&nbsp;&nbsp;
                成交量：<a id="cjl"></a>&nbsp;&nbsp;&nbsp;&nbsp;
                成交金额：<a id="cjje"></a>&nbsp;&nbsp;&nbsp;&nbsp;
                <br>
                实际日期：<a id="sjrq"></a>&nbsp;&nbsp;&nbsp;&nbsp;
                成交时间：<a id="cjsj"></a>&nbsp;&nbsp;&nbsp;&nbsp;
                <br>
                系统号：<a id="xth"></a>&nbsp;&nbsp;&nbsp;&nbsp;
                <br>
                手续费：<a id="sxf"></a>&nbsp;&nbsp;&nbsp;&nbsp;
                平仓浮动盈亏：<a id="pcfdyk"></a>&nbsp;&nbsp;&nbsp;&nbsp;
                平仓盈亏：<a id="pcyk"></a>&nbsp;&nbsp;&nbsp;&nbsp;
                <br>
                基础手续费：<a id="jcsxf"></a>&nbsp;&nbsp;&nbsp;&nbsp;
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
</div>
</body>
</html>

{/block}


{block name='my'}
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="/static/admin/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<!--<script type="text/javascript" src="/static/admin/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>-->
<script type="text/javascript" src="/static/admin/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript">
    function rz($uid) {
        $.ajax({
            type: 'get',
            url: "{:url('zbj/Transaction/xq')}",
            dataType: 'json',
            data: {'id': $uid},
            success: function (data) {
                console.log(data);
                $('#name').html('ID ' + '<a>' + data.Id + '</a>' + ' 的详情：');
                $('#zzh').html(data.Subaccount);
                $('#ssfz').html(data.Grouping);
                $('#jyr').html(data.TradingDday);
                $('#wth').html(data.Entrustment);
                $('#cjh').html(data.Deal);
                $('#qqh').html(data.Request);
                $('#jys').html(data.Exchange);
                $('#hy').html(data.Contract);
                $('#mm').html(data.Business);
                $('#kp').html(data.Kaiping);
                $('#tb').html(data.Insure);
                $('#cjj').html(data.Price);
                $('#cjl').html(data.Count);
                $('#cjje').html(data.Amount);
                $('#sjrq').html(data.Date);
                $('#cjsj').html(data.Time);
                $('#xth').html(data.System);
                $('#sxf').html(data.Poundage);
                $('#pcfdyk').html(data.Float);
                $('#pcyk').html(data.Profit);
                $('#jcsxf').html(data.Brokerage);
            },
            error: function () {
                console.log('ajax操作失败');
            }
        });
    }
</script>



{/block}